<template>
  <div class="goods">
    <h3>{{ pname }}</h3>
    <p>{{ info }}</p>
    <p>商品价格:{{ price }}</p>
    <button @click="$emit('kanyidao', 1, id)">砍一刀</button>
  </div>
</template>

<script>
export default {
props:{
  id:{
    required:true,
    type:Number
  },
  pname:{
    default:'鸡你太美',
    type:String
  },
  price:Number,
  info:{
    required: true,
    type: [Number,String] 
  }
}
}
</script>

<style>
.goods {
  padding: 5px;
  margin: 10px;
  border: solid 2px black;
}
</style>